<?php
/**
 * Created by PhpStorm.
 * Author: daly
 * Date: 2020/5/21
 * Time: 13:16
 * TEL : 18665585707  Weacht:awngxiaogang
 * luck: 520
 */

namespace app\admin\validate;

use think\validate;

class Nav extends validate
{

    protected $rule =   [

        'name'  => ['require',  'unique'=>'nav'],

    ];

    protected $message  =   [

        'name.require'     => ['code' => 4011, 'msg' => '名称不能为空'],
        'name.unique'      => ['code' => 4012, 'msg' => '名称已经存在'],

    ];

    // edit 验证场景定义
    public function sceneModify()
    {
        return $this->only(['phone','password'])
            ->remove('username', 'unique');
    }
}